$ = (selector) ->
	main = selector
	index = Math.max.apply this, [' ', '+', '>'].map (op) ->
				selector.lastIndexOf op
	main = selector.substr index if index > 0

	return document.getElementById selector.substr(1) if main[0] is '#'
	return document.body.querySelectorAll selector

_ = {}
_.extend = (obj, prop) ->
	obj = obj or {}
	for key of prop
		obj[key] = prop[key]
	return obj
_.getMouseLoc = (event) ->
	x: event.pageX
	y: event.pageY
